<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/4/11
  Time: 17:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<html lang="en">

<head>

    <!-- Basic -->
    <meta charset="UTF-8"/>

    <title>编辑员工</title>

    <!-- Mobile Metas -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link href="${pageContext.request.contextPath}/dist/backEnd/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="${pageContext.request.contextPath}/dist/backEnd/css/skycons.css" rel="stylesheet"/>
    <link href="${pageContext.request.contextPath}/dist/backEnd/css/font-awesome.min.css" rel="stylesheet"/>
    <link href="${pageContext.request.contextPath}/dist/backEnd/css/pace.preloader.css" rel="stylesheet"/>
    <link href="${pageContext.request.contextPath}/dist/backEnd/css/style.css" rel="stylesheet"/>
     
    <script type="application/javascript">
        window.onload=function () {
            var saveForm=document.getElementById("saveForm");
            if('${msg}' == '添加成功' || '${msg}' == '修改成功'){
                window.location.href="${pageContext.request.contextPath}/XzEmp/toEmpShowPage.emp";
            }
            if('${xzEmp.empId}' != 0){
                saveForm.action="${pageContext.request.contextPath}/XzEmp/updateEmp.emp";
            }
        }

       function ToempShowPage() {
         window.location.href="${pageContext.request.contextPath}/XzEmp/toEmpShowPage.emp";
       }
    </script>

</head>

<body>

<!--头部开始-->
<jsp:include page="headerBack.jsp"></jsp:include>
<!-- 导航 -->
<jsp:include page="leftBack.jsp"></jsp:include>

<!--内容页-->
<div class="main" style="background-color: #ecedf0">
    <!-- Page Header -->
    <div class="page-header">
        <div class="pull-left">
            <ol class="breadcrumb visible-sm visible-md visible-lg">
                <li><a href="two.html"><i class="icon fa fa-home"></i>首页</a></li>
                <li class="active"><i class="fa fa-pencil"></i>编辑信息</li>
            </ol>
        </div>
        <div class="pull-right">
            <h2>编辑信息</h2>
        </div>
    </div>
    <!-- End Page Header -->
    <div class="row profile">
        <div class="col-lg-11">
            <div class="col-lg-7 col-md-9 col-sm-12" >
                <div class="panel">
                    <div class="panel-body">
                        <div class="tabs tabs-warning">
                            <ul class="nav nav-tabs">
                                <li class="active">
                                    <a href="#edit" data-toggle="tab">编辑信息</a>
                                </li>
                            </ul>
                            <div class="tab-content">
                                <div id="edit" class="tab-pane updateProfile active">
                                    <sf:form class="form-horizontal" action="${pageContext.request.contextPath}/XzEmp/addEmp.emp" modelAttribute="xzEmp" id="saveForm" method="post">
                                        <div class="bk-bg-white bk-padding-top-10 bk-padding-bottom-10">
                                            <h4>个人基本信息</h4>
                                            <fieldset>
                                                <div>
                                                    <div><sf:input type="hidden" name="empId"   path="empId"/></div>
                                                </div>

                                                <div class="form-group">
                                                    <label>员工工号</label>
                                                    <c:if test="${xzEmp.empNo == 0}"> <input type="text" class="form-control" name="empNo" /></c:if>
                                                    <c:if test="${xzEmp.empNo != 0}">  <sf:input type="text" class="form-control"  path="empNo"  readonly="true"/></c:if>

                                                    <%--<sf:input type="text" class="form-control" name="empNo" path="empNo"/>--%>
                                                    <%--<span style="color: #ba0000"> <sf:errors  path="empNo"/> </span>--%>
                                                </div>
                                                <div class="form-group">
                                                    <label>姓名</label>
                                                    <sf:input type="text" class="form-control" name="empName" path="empName"/>
                                                    <span style="color: #ba0000"> <sf:errors  path="empName"/> </span>
                                                </div>
                                                <div class="form-group">
                                                    <label>电话</label>
                                                    <sf:input type="text" class="form-control" name="empTel" path="empTel"/>
                                                    <span style="color: #ba0000"> ${TelMessge}<sf:errors  path="empTel"/> </span>
                                                    
                                                </div>

                                                <div class="form-group">


                                                    <label>员工账户</label>
                                                    <c:if test="${editType == 'add'}"> <sf:input type="text" class="form-control" name="empAccount"  path="empAccount"/>
                                                        <span style="color: #ba0000"> <sf:errors  path="empAccount"/> </span>
                                                    </c:if>
                                                   <c:if test="${editType == 'update'}"><input type="text" class="form-control" name="empAccount" value="${xzEmp.empAccount}" readonly="true"/></c:if>

                                                </div>
                                                <div class="form-group">
                                                    <label>员工密码</label>
                                                    <sf:input type="text" class="form-control" name="empPwd"  path="empPwd"/>
                                                    <span style="color: #ba0000"> <sf:errors  path="empPwd"/> </span>
                                                </div>

                                            </fieldset>

                                            <div class="bk-bg-white">
                                                <div class="row">
                                                    <div class="col-md-12">
                                                        <div class="pull-right">

                                                            <button type="submit" class="btn btn-primary">提交</button>
                                                            &nbsp;&nbsp;
                                                            <button type="button" class="btn btn-primary" onclick="ToempShowPage()">取消</button>

                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </sf:form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="clearfix"></div>
</body>
</html>


